import request from '../utils/Request'

export function findDistricts() {
  return request.fetch({
    url: 'system/findDistricts',
    method: 'get'
  })
}

export function uploadFile(filePath, formData = {}) {
  return new Promise((resolve, reject) => {
    wx.uploadFile({
      url: process.env.BASE_API + 'system/uploadFile', // 仅为示例，非真实的接口地址
      filePath: filePath,
      name: 'file',
      formData: formData,
      success(res) {
        // 上传完成需要更新 fileList
        resolve(res)
      },
      fail(err) {
        reject(err)
      }
    })
  })
}
